<?php include( "templates/include/header.php" ); ?>

<?php
  $data = array();
  $data = Gallery::getList();
  $results['gallery'] = $data['results'];

  $count = 0;
  foreach ( $results['gallery'] as $gallery ) { ?>
  <div align="left" class="Box">
    <div class="BoxTitle" onclick="$('#box_<?php echo( $count );?>').toggle();" style="cursor:pointer">
    	<font style="font-size:large;font-weight:bold;">
			<?php echo( $gallery->title ); ?>
      </font>
  	</div>

	  <div id="box_<?php echo( $count );?>" class="BoxContent" style="display:none">
	  	<table align="center" cellpadding="2px" cellspacing="5px">
		  	<tr>
		  	</tr>
        <tr>
        <?php
          $list = array();
          $list = $gallery->getImages();
          foreach( $list['results'] as $image ) { ?>
            <td align="center" valign="bottom">
  				  	<a href="<?php echo( $image['image'] );?>" class="lightbox"><img id="img_<?php echo( $image['id'] );?>" style="cursor:pointer" width="150px" src="<?php echo( $image['image'] );?>" /></a>
    				</td>
        <?php } ?>
      </table>
    </div>
  </div>
  </br>
<?php
  $count++;
} ?>

<?php include( "templates/include/footer.php"); ?>
